package com.bw.visit

import android.widget.TextView
import com.bw.lib_base.entity.VisitStatus
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder

class VisitStatusAdapter:BaseQuickAdapter<VisitStatus,BaseViewHolder>(R.layout.item_visitstatus) {
    override fun convert(helper: BaseViewHolder, item: VisitStatus) {
        val tv = helper.getView<TextView>(R.id.vis_status)
        tv.setText(item.status)
        if (item.isCheck){
            tv.setBackgroundResource(R.drawable.shape_status)
            tv.setTextColor(context.resources.getColor(R.color.blue))
        }else{
            tv.setBackgroundResource(R.drawable.shape_solid_lightgray)
            tv.setTextColor(context.resources.getColor(R.color.black))
        }
    }
}